package org.homeworkteam.service;

import org.homeworkteam.bean.Admin;
import org.homeworkteam.mapper.AdminMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminService {

    @Autowired
    private AdminMapper adminMapper;

    /**
     * 根据 admin_id 查询管理员姓名
     *
     * @param adminId 管理员 ID
     * @return 管理员姓名
     */
    public String getAdminNameById(Integer adminId) {
        // 查询管理员信息
        Admin admin = adminMapper.selectById(adminId);
        return (admin != null) ? admin.getAdminName() : null;
    }
}
